package com.mirabelle.juice.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the use_base database table.
 * 
 */
@Embeddable
public class UseBasePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private Integer recipeId;
	private Integer baseId;

	public UseBasePK() {
	}

	@Column(name="recipe_id", unique=true, nullable=false)
	public Integer getRecipeId() {
		return this.recipeId;
	}
	public void setRecipeId(Integer recipeId) {
		this.recipeId = recipeId;
	}

	@Column(name="base_id", unique=true, nullable=false)
	public Integer getBaseId() {
		return this.baseId;
	}
	public void setBaseId(Integer baseId) {
		this.baseId = baseId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof UseBasePK)) {
			return false;
		}
		UseBasePK castOther = (UseBasePK)other;
		return 
			this.recipeId.equals(castOther.recipeId)
			&& this.baseId.equals(castOther.baseId);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.recipeId.hashCode();
		hash = hash * prime + this.baseId.hashCode();
		
		return hash;
	}
}